INCLUDE= -I../third/include
LIBRARY= -L../third/lib
LINK= -lmuduo_net -lmuduo_base -lprotobuf -lsqlite3 -lz -ljsoncpp -pthread

.PHONY:all
all:../build/micromq_server ../build/producer_client ../build/consumer_client

../build/micromq_server:MicroMQServer.cc ../common/message.pb.cc ../common/protocol.pb.cc ../third/include/muduo/proto/codec.cc
	g++ -o $@ $^ -std=c++17 $(INCLUDE) $(LIBRARY) $(LINK) -g

../build/producer_client:ProducerClient.cc ../common/message.pb.cc ../common/protocol.pb.cc ../third/include/muduo/proto/codec.cc
	g++ -o $@ $^ -std=c++17 $(INCLUDE) $(LIBRARY) $(LINK) -g

../build/consumer_client:ConsumerClient.cc ../common/message.pb.cc ../common/protocol.pb.cc ../third/include/muduo/proto/codec.cc
	g++ -o $@ $^ -std=c++17 $(INCLUDE) $(LIBRARY) $(LINK) -g

.PHONY:clean
clean:
	rm -rf ../build/micromq_server ../build/data ../build/producer_client ../build/consumer_client